Combinations essentially asks, how many subsets with length $r$ can you make out of a set $S$?
all subsets of length $r$ are called $r \text{-combinations}$
$n\choose r$ is read as "n choose r" to represent the amount of subsets of size $r$ that can be created from a set of size $n$
Examples
Combinations, just like permutations, show up all over the place in real life. Here's a real example: I participated in the 2025 Hackabull Hackathon, which had 195 participants. For the example, let's say there were actually 196 participant. If I wanted to know how many teams of 4 hackers I could make this would be a fairly tricky. It's going to be a big number.
In order to calculate this number we have to first understand exactly what we are asking. When we think of a team of 4 hackers we are talking about 4 particular individuals grouped together with their own chemistry and skill set. A team of made up of hackers Ryan, Bernardo, Quynh, and Kadin is a different team than one made up of hackers Ryan, Bernardo, Andrew, and Kadin.
It's also important to note that the
You can see the number for yourself using this python script:
from math import comb
print(comb(196,4))
Symbolically...
$$196 \choose 4$$
Team Example
If you were to calculate how many teams of 5 you could construct from a group of 12 players, how many would you choose?
Total combinations
$$12\choose 5$$ This r-combination represents all the teams of 5 players you can make with a group of 12 players.
Both
What if two players must be on the same team together?
- subtract two from the players you can choose from because two players are always on a team: $$12\choose 3$$
Neither
What if two players mustn't to be on the same team together?
- what are all the teams where neither are on a team. In practice, this would be like choosing teams with out them in the roster, which is why you subtract 2 from n: $$10\choose 5$$
One and not the Other
What if one player wants to be on a team without the other?
- calculate the teams with a particular member on it
- subtract those teams that have another particular member on it from that new count of n and choice: $$ {11 \choose 4}-{10 \choose 3} $$
Both or Neither
What if I want to calculate the number of teams that either have two players on the same team or not on a team at all?
- calculate the instances where one is not on the team of the other or the other is not on the team of the one.
- subtract those cases from the total number of cases and that will tell you when they are both on a team or not on a team: $$ {12\choose 5}-2\left[{11\choose 4}-{10\choose 3}\right] $$